#!/bin/sh

price=$( expr $RANDOM % 100 )
times=0
echo "猜价格是多少（0-100）"

while true
do
    read -p "输入猜测价格:" int
    let times++
    if [ $int -eq $price ]
    then
        echo "bingo!the price is:$price"
        echo "you guess $times times"
        exit 0
    elif [ $int -gt $price ]
    then
        echo "too high!"
    else
        echo "too low!"
    fi
done
